<template>
	<view>
		
		 
	<!-- 底部按钮 -->
	<!-- replyHit评论数量 -->
	 <bottom-but  @showCommentInput='showCommentInput' @showCommentList="showCommentList" :replyHit="4"/>
	<!-- 评论输入框 -->
	 <comment-input :show="isShow" @showCommentInput="showCommentInput" @sedComment="sedComment" ></comment-input>
	 <!-- 弹出评论列表-->
	 <qcy-comment ref="commentList" :show="isShowCommentList" @showCommentList="showCommentList" :commentList="commentList"></qcy-comment>
	</view>
</template>

<script>
	import bottomBut from '@/uni_modules/qcy-comment/components/bottom-but/bottom-but.vue'
	import commentInput from '@/uni_modules/qcy-comment/components/comment-input/comment-input.vue'
	import qcyComment from '@/uni_modules/qcy-comment/components/qcy-comment/qcy-comment.vue'
	
	export default {
		data() {
			return {
				isShow:false,//展示输入框
				isShowCommentList:false,//展示评论列表
			
				commentList:[
									 {
										
										 content: "测试app",
										 createTime: "2022-04-02 11:20:47",
										 createUserId: "1",
										 createUserName: "用户1",
										 id: 79,
										 parentId: null,
										 parentUserName: null,
										 userAvatar: null,
									 },
									 {
										 
										 content: "新的",
										 createTime: "2022-04-02 11:30:41",
										 createUserId: "1",
										 createUserName: "用户2",
										 id: 81,
										 parentId: null,
										 parentUserName: null,
										 userAvatar: null
									 },
									 {
										 
										 content: "11",
										 createTime: "2022-04-15 12:20:05",
										 createUserId: null,
										 createUserName: "用户3",
										 id: 96,
										 parentId: 81,
										 parentUserName: "用户2",
										 state: null,
										 userAvatar: null
									 },
									 {
										 content: "44",
										 createTime: "2022-04-15 12:20:34",
										 createUserId: null,
										 createUserName: "用户4",
										 id: 97,
										 parentId: 79,
										 parentUserName: "用户1",
										 state: null,
										 userAvatar: null,
									 },
									 {
										 content: "4466666666666666",
										 createTime: "2022-04-15 12:20:34",
										 createUserId: null,
										 createUserName: "用户4",
										 id: 98,
										 parentId: 79,
										 parentUserName: "用户1",
										 state: null,
										 userAvatar: null,
									 }
									 
				]
			}
		},
		components:{
			bottomBut,commentInput,qcyComment
		},
		methods: {
			/* 显示评论输入框 */
			showCommentInput(isShow){
				console.log(isShow)
				this.isShow=isShow
			},
			/* 显示评论 */
			showCommentList(isShowCommentList){
				console.log("showCommentList="+isShowCommentList)
				
				this.isShowCommentList=isShowCommentList
				this.$nextTick(function(){
					this.$refs.commentList.open();
				})
				
				
			},
			
			sedComment(val){
				console.log(val)
				this.isShow=false
			}
		}
	}
</script>

<style>

</style>
